package com.gcloud.boot.test.mq;

import java.util.Date;
import java.util.UUID;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.rabbit.support.CorrelationData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
//@Component
public class HelloSender {
	 
    @Autowired
    private AmqpTemplate rabbitTemplate;
    //@Value("${service.controller}")
	private String queueName;
    public void send() {
        String context = "hello " + new Date();
        System.out.println("Sender : " + context);
        //this.rabbitTemplate.convertAndSend(queueName, context);
        //this.rabbitTemplate.convertAndSend("hello", context);
       //rabbitTemplate.
        CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
        //Object response= this.rabbitTemplate.convertSendAndReceive(queueName,new User());
        //User user=(User) response;
        //System.out.println(user.getUsername());
        
    }
 
}